import {
  _decorator,
  Component,
  instantiate,
  IVec2,
  Node,
  UITransform,
  Vec2,
} from "cc";
import DataManager from "../../Global/DataManager";
import { EntityTypeEnum, IActor, IBullet, InputTypeEnum } from "../../Common";
import { EntityManager } from "../../Base/EntityManager";
import { ExplotionStateManager } from "./ExplotionStateManager";
import { ActorStateEnum, EventEnum } from "../../Enum";
import EventManager from "../../Global/EventManager";
import { rad2Angle } from "../../Utils";
const { ccclass, property } = _decorator;

@ccclass("ExplosionManager")
export class ExplosionManager extends EntityManager {
  type: EntityTypeEnum;

  start() {}

  init(type: EntityTypeEnum, { x, y }: IVec2) {
    this.type = type;
    this.node.setPosition(x, y);

    this.fsm = this.node.addComponent(ExplotionStateManager);
    this.fsm.init(type);
    this.state = ActorStateEnum.Idle;
  }
}
